import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd(), '')
  return {
    build: {
      outDir: env.VITE_APP_OutputDir,
      // manifest: true,
    },
    resolve: {
      alias: {
        "@": "/src"
      }
    },
    css: {
      preprocessorOptions: {
        scss: {
          api: "modern-compiler"
          // additionalData: `@import "@/assets/css/_variable.scss";`
        }
      }
    },
    plugins: [vue(), VueSetupExtend()]
  }
})
